using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class RailButton : MonoBehaviour
{
    public Text indexText;
    public int index;
    public PlayerControllerDraw playerController;
    // Start is called before the first frame update
    void Start()
    {
        indexText = GetComponentInChildren<Text>();
    }

    // Update is called once per frame
    void Update()
    {
        indexText.text = (index + 1).ToString();
    }

    public void ButtonClick()
    {
        playerController.SelectRailButton(index);
    }
}
